<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>05_版心与居中测试</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .main{
            background-color: #ff0;
        }
        .center{
            width: 1000px;
            background-color: #00f;
            margin: 0 auto;
        }
        .card{
            width: 200px;
            height: 300px;
            background-color: pink;
            border: 3px solid red;
            margin: 0 auto;/*在版心里居中*/
            text-align: center;/*文字水平居中*/
            line-height: 300px;/*文字垂直居中*/
        }

    </style>
</head>
<body>
    <!--最外层功能模块-->
    <div class="main">
        <!--版心-->
        <div class="center">
            <!--主要展示内容-->
            <div class="card">我是内容</div>
            <div class="card">我是内容</div>
            <div class="card">我是内容</div>
            <div class="card">我是内容</div>
        </div>
    </div>

</body>
</html>